/*
    OpenLib
    Copyright (C) 2011  Michael Gukov

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


jsun.include_once("pub/jsun/dom.js");

var app = { };

app.layer = { };
app.layer.admin = { };
app.layer.reader = { };

app.layer.admin.service = function() {

    jsun.dom.create_list(jsun.dom.list_by_id(["ListUsers", "SqlQuery"]))
        .event("onclick", "e1", Service);

    function Service() {
        var params = {
            'ListUsers' : "u=Controll/Admin&p=ListUsers",
            'SqlQuery'  : "u=Controll/Admin&p=SqlQuery"
        };
        var id = this.id;
        jsun.ajax.simple_request(function(req) {
            jsun.dom.by_id("UserWorkSpace").innerHTML = req.responseText;
        }, params[id]);
        return true;
    }
};


//app.layer.main = function() {
    document.getElementById(document.getElementById("Page").value).
            setAttribute("class", "selected");
//};
